//
//  PeopleInforTableViewCell.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/10/25.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "PeopleInforTableViewCell.h"
#import "UIImageView+LoadwebImage.h"
@implementation PeopleInforTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.IcoImageView.layer.cornerRadius=self.IcoImageView.width/2.0;
    
    self.IcoImageView.layer.masksToBounds=YES;
    // Initialization code
}

-(void)setIsClick:(BOOL)isClick
{
    _isClick=isClick;
    
    if (self.isClick) {
        self.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    }else{
         self.accessoryType=UITableViewCellAccessoryNone;
    }
    
}

-(void)setDeleStatue:(BOOL)deleStatue
{
    _deleStatue=deleStatue;
    
    if (deleStatue) {
        
        self.editImageView.hidden=NO;
        
          self.accessoryType=UITableViewCellAccessoryNone;
        
    }else{
        
        self.editImageView.hidden=YES;
        
      self.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
        
    }
    
}

-(void)setWorkData:(WorkData *)WorkData
{
    _WorkData=WorkData;
    
    [self.IcoImageView LoadWebImageWithName:WorkData.staffPhoto andIsOrgin:NO andPlaceImage:@"PeopleImage"];
    
    if (self.isClick) {
        
        self.TitleLabel.text=WorkData.staffName;
        
        self.JobLabel.text=[NSString stringWithFormat:@"职位:%@",WorkData.postName==nil?@"":WorkData.postName];
        
        self.JobtwoLabel.hidden=YES;
        
        if (WorkData.Select) {
            
            self.editImageView.image=[UIImage imageNamed:@"Select"];
            
        }else{
            
             self.editImageView.image=[UIImage imageNamed:@"UnSelect"];
        }
        
        
    }else{
        self.TitleLabel.text=WorkData.staffName;
        
        self.JobLabel.text=WorkData.shopName;
        
        self.JobtwoLabel.text=WorkData.postName==nil?@"":WorkData.postName;;
        
        self.JobtwoLabel.hidden=NO;
        
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
